Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test case related to spreading objects #57642

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Mar 4, 2024

test case for #48178
it was fixed by #53413

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 4, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@RyanCavanaugh RyanCavanaugh merged commit 0f6f7c3 into microsoft:main Mar 4, 2024
19 checks passed
@jakebailey
Copy link
Member

#53413 shouldn't have fixed anything, so I do wonder what the heck I did...

@Andarist
Copy link
Contributor Author

Andarist commented Mar 5, 2024

@jakebailey the circularity was caused by subtype reduction - ur PR avoids it in certain cases and thus it accidentally~ fixed this issue

@Andarist
Copy link
Contributor Author

Andarist commented Mar 5, 2024

I re-checked and at the time the circularity was encountered by the subtype reduction we can see those types when we get to your optimization:

typeToString(getTypeOfSymbol(leftProp)) // Foo | Box
typeToString(rightType) // Foo | Box | undefined

So it makes sense that we don't get to the circularity now since u avoid that subtype reduction based on this check:

result.links.type = leftTypeWithoutUndefined === rightTypeWithoutUndefined ? leftType : getUnionType([leftType, rightTypeWithoutUndefined], UnionReduction.Subtype);

I'd call it - "accidental but good" :P

@Andarist Andarist deleted the tests/spread-no-circular branch March 5, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants